Simple phase envelope algorithm